@use "sass:map";
@use "sass:meta";
@use "sass:list"; // 新增列表模块
@use "theme-variables" as *;

@mixin theme-variant($property, $key) {
  // 默认主题
  #{$property}: map.get(map.get($themes, "default"), $key);

  // 暗色主题
  .dark & {
    $values: map.get(map.get($themes, "dark"), $key);
    
    @if meta.type-of($values) == list {
      // 使用 list.join 替代全局 join()
      #{$property}: list.join($values, (), $separator: comma);
    } @else {
      #{$property}: $values;
    }
  }
}